package com.spzx.product.mapper;

import com.spzx.model.dto.h5.ProductSkuDto;
import com.spzx.model.entity.product.ProductSku;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * Project: spzx-parent
 * Package: com.spzx.product.mapper
 * Version: 1.0
 * <p>
 * Created by  wangjiaxin  on 2024/3/12 23:04
 */
@Mapper
public interface ProductSkuMapper {
    //对销量进行排序，获取前10条记录
    List<ProductSku> findProductSkuBySale();

    //商品列表分页查询
    List<ProductSku> findByPage(ProductSkuDto productSkuDto);

    //获取sku信息
    ProductSku getById(Long skuId);

    //根据商品id获取ProductSku列表
    List<ProductSku> findByProductId(Long productId);

    //更新商品sku销量
    void updateSale(Long skuId, Integer num);
}
